package com.ruoyi.config

import cn.hutool.core.date.DateUtil
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler
import com.baomidou.shaun.core.context.ProfileHolder
import com.baomidou.shaun.core.profile.TokenProfile
import com.ruoyi.common.utils.SecurityUtils
import org.apache.ibatis.reflection.MetaObject
import org.springframework.stereotype.Component
import java.util.*

@Component
class MyMetaObjectHandler : MetaObjectHandler {


    override fun insertFill(metaObject: MetaObject) {
        this.strictInsertFill(metaObject, "createTime", Date::class.java, DateUtil.date())
    }

    override fun updateFill(metaObject: MetaObject) {
        this.strictUpdateFill(metaObject, "updateTime", Date::class.java, DateUtil.date())
    }
}